package com.wanxi.user.mapper;

import com.wanxi.user.domain.dto.AddressDefaultDto;
import com.wanxi.user.domain.dto.AddressDto;
import com.wanxi.user.domain.entity.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author:Iny
 * @Data：2022/1/4 10:15
 */
@Mapper
public interface AddressMapper {
    List<Address> findByUserId(long userId);

    int addAddress(AddressDto addressDto);

    int findUserIdByAddress(long id);

    int updateDefaultByUserIdAndDefault(int userId);

    int updateDefaultByAddressId(AddressDefaultDto addressDefaultDto);

    int deleteAddress(long id);

    int updateAddress(AddressDto addressDto);

    Address findAddressById(long id);
}
